/*
 * @Author: sean_kei@163.com
 * @Date: 2022-08-24 11:23:29
 * @LastEditors: sean_kei@163.com
 * @LastEditTime: 2022-08-24 11:25:45
 */
package com.wxhandle.cleandemo.sso.oauth2.customizer.jwt;

import org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext;

import com.wxhandle.cleandemo.sso.oauth2.customizer.jwt.impl.DefaultJwtCustomizerHandler;
import com.wxhandle.cleandemo.sso.oauth2.customizer.jwt.impl.OAuth2AuthenticationTokenJwtCustomizerHandler;
import com.wxhandle.cleandemo.sso.oauth2.customizer.jwt.impl.UsernamePasswordAuthenticationTokenJwtCustomizerHandler;

public interface JwtCustomizerHandler {

	void customize(JwtEncodingContext jwtEncodingContext);

	static JwtCustomizerHandler getJwtCustomizerHandler() {

		JwtCustomizerHandler defaultJwtCustomizerHandler = new DefaultJwtCustomizerHandler();
		JwtCustomizerHandler oauth2AuthenticationTokenJwtCustomizerHandler = new OAuth2AuthenticationTokenJwtCustomizerHandler(defaultJwtCustomizerHandler);
		JwtCustomizerHandler usernamePasswordAuthenticationTokenJwtCustomizerHandler = new UsernamePasswordAuthenticationTokenJwtCustomizerHandler(oauth2AuthenticationTokenJwtCustomizerHandler);
		return usernamePasswordAuthenticationTokenJwtCustomizerHandler;


	}

}
